Repository navigation
[APPS-2961] Update: run local backend function calls in parallel, with per-call log prefixes - #603
Conversation
Live Debugger Runtime BenchmarkSDK-loaded dormant-probe runtime overhead, measured against an uninstrumented bundle in the same browser session.
What do the Tiny and Hot workloads represent? Browser Debugger SDK: Full diagnosticsRaw samples are in the |
1b04081 to
cfac113
Compare
cfac113 to
401268c
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 401268c033
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified in concurrency accounting, query sharing, error handling, logging, or regression coverage.
No open issues 🎉
What changed in this PR
Builds on process isolation to run local backend calls concurrently on Vite 6+, while preserving serial execution for the in-process fallback.
Changes:
- Allows up to 25 concurrent calls, returning HTTP 429 when full.
- Adds per-call log prefixes and shares in-flight runtime-context queries.
- Updates regression tests and local-execution documentation.
| File | Description |
|---|---|
| packages/plugins/apps/src/vite/local-execution.ts | Makes the in-process queue helper private. |
| packages/plugins/apps/src/vite/local-execution-process.ts | Adds concurrency limits and per-call log prefixes. |
| packages/plugins/apps/src/vite/local-execution-process.test.ts | Tests parallelism, slot release, isolation, and logging. |
| packages/plugins/apps/src/vite/dev-server.ts | Shares context queries and handles HTTP 429 responses. |
| packages/plugins/apps/src/vite/dev-server.test.ts | Tests query sharing, refresh, and concurrency errors. |
| packages/plugins/apps/README.md | Documents concurrent execution and prefixed logs. |
Review effort: Balanced
oliverli
left a comment
There was a problem hiding this comment.
Approved. The change is correct. I added two optional nits.
4c9b050 to
aa5b6d7
Compare
401268c to
002f14e
Compare
aa5b6d7 to
ba6b653
Compare
f698ad5 to
7e9b4b4
Compare
|
@codex review |
86c8430 to
b50260f
Compare
7dc7d64 to
160bbaa
Compare
b50260f to
fbd073c
Compare
160bbaa to
c89cc54
Compare
fbd073c to
f0977cc
Compare
c89cc54 to
09ba149
Compare
f0977cc to
a1c4904
Compare
09ba149 to
82157b9
Compare
a1c4904 to
9ac932c
Compare
82157b9 to
1544220
Compare
9ac932c to
00ec61c
Compare
1544220 to
bb0797f
Compare
00ec61c to
1ed9fb5
Compare
…l log prefixes Each call already gets a fresh process, so calls no longer queue and run in parallel, with no local limit: production's concurrency limits vary by org, and dev:verify runs against them. Calls that start while a runtime context query is in flight share it, so a burst sends Datadog one query instead of one per call. Each line a call writes is prefixed with its function name and call number. A failed $.Actions call now rejects as it does in a deployed app: with a bare string holding the platform's error detail, the deployed inputs or no-arguments message, or the local allowlist message, not an Error. An uncaught failure in the function's code reports as it does in a deployed app: the dev server's error is "Execution failed: " followed by the thrown Error's stack or the thrown value, and the dev transport throws that message instead of the status and raw response body. Refs: APPS-2961 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1ed9fb5 to
69f856f
Compare
Motivation
Architecture
sequenceDiagram participant App as App frontend (dev client) participant D as Vite dev server participant C1 as Call 1 process participant C2 as Call 2 process participant API as Datadog API App->>D: executeAction (call 1) App->>D: executeAction (call 2) D->>API: One runtime-context lookup, shared by both calls API-->>D: Runtime context ($) par Calls run in parallel, no local limit D->>C1: start C1-->>D: Log lines, printed as [fn#35;1] ... and D->>C2: start C2-->>D: Log lines, printed as [fn#35;2] ... end C1->>D: $.Actions call fails D-->>C1: Rejects with the platform's bare string C1->>D: result D-->>App: 200 with the result C2->>D: Uncaught error D-->>App: 500 {error: "Execution failed: #lt;message#gt;"} Note over App: The dev client throws BackendFunctionError("Execution failed: #lt;message#gt;")Changes
10 changes across local-execution-process.ts, dev-server.ts, local-execution-shared.ts, dev-server-transport.ts, the README and tests
local-execution-process.ts,local-execution.ts[<function>#N].local-execution-process.tslocal-execution-process.ts,local-execution-child.ts,local-execution-protocol.tsdev-server.ts$.Actionscall with the platform's bare string.dev-server.tsExecution failed: <stack or value>.dev-server.ts,local-execution-shared.ts,local-execution-child.ts$.Actionscalls with deployed-wording strings.local-execution-shared.tserror, else the status and body.dev-server-transport.tsREADME.mdlocal-execution-process.integration.test.ts,dev-server.test.ts,execute-backend-function.test.tsQA Instructions
00ec61cb, as are the staging checks in a Datadog staging org.[logLines#N]prefixes also pass through real Vite 7.3.7 and 8.3.3 dev servers in the suite from [APPS-2961] Add: CI matrix running local execution against real Vite 7 and 8 installs #606, verified on Node 20.19.4 and 24.22.1 with this branch's packed plugin at71953bda, which adds only CI and that suite on top.qa-parallel.mjs[<function>#N]qa-parallel.mjsExecution failed: Error: qa boom …; the others return 200qa-parallel.mjsqa-parallel.mjsqa-parallel.mjsa connection is required for …run.shNo arguments provided …, or… must have an inputs field that is an objectrun.shrpc error: code = NotFound …run.shrun.shBackendFunctionError:Execution failed: <message or stack>transport-run.shLocal parallel-call harness and raw output
node_modules/vitelinks to the repo's Vite, with the plugin built byyarn workspace @datadog/vite-plugin build:Staging fixtures, helper scripts and raw output
executeBackendFunction:Blast Radius
dev:verifyincluded.Out of Scope / Follow-ups
1 item deferred
$.Actionsfailures) lack its prefix.Documentation
🤖 Generated with Claude Code